<#assign module="sys"/>

<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
</@override>
<@override name="body">
<div class="row">
  <div class="col-xs-12">
  	<form class="form-inline" role="form">
  		<div class="form-group" style="width:25%;">
		    <input type="text" class="form-control" style="width:100%;" id="operating" name="operating" value="${operating?if_exists}" placeholder="输入操作详细、所属公司、操作人、ip地址">
	  	</div>
	  	<div class="form-group">
            <input class="form-control" id="startTime" name="startTime" placeholder="开始时间" readonly="readonly" type="text" <#if start??>value="${start?string('yyyy-MM-dd')}"</#if>>
        </div>
        <div class="form-group">
            <input class="form-control" id="endTime" name="endTime" placeholder="结束时间" readonly="readonly" type="text" <#if end??>value="${end?string('yyyy-MM-dd')}"</#if>>
        </div>
	  	<button type="submit" class="btn btn-primary"><i class="icon-search"></i>&nbsp;搜索</button>
	  	<button id="all_button" type="button" class="btn btn-primary"><i class="icon-search"></i>&nbsp;全部</button>
	  	<button id="export_button" type="button" class="btn btn-primary"><i class="glyphicon glyphicon-save"></i>&nbsp;导出</button>
  	</form>
  </div>
</div>
<div class="row margin-top">
	<div class="col-xs-12">
	<div class="panel panel-primary">
	<div class="table-responsive">
		<table class="table table-hover table-striped">
			<thead>
			<tr style="font-size:14px;">
				<th>操作详细</th>
				<th>所属公司</th>
				<th>操作人</th>
				<th>ip地址</th>
				<th>归属地</th>
				<th>时间</th>
			</tr>
			</thead>
			<tbody>
				<#if (page.content)?? >
				  	<#list page.content as data>
						<tr>
							<td style="max-width:650px;">${data.detail?if_exists}</td>
							<td>${data.companyName?if_exists}</td>
							<td>${data.operating?if_exists}</td>
							<td class="ip">${data.host?if_exists}</td>
							<td class="address">-</td>
							<td>${data.created?datetime}</td>
						</tr>
					</#list>
				</#if>
			</tbody>
		</table>
		<#if page.totalElements??>
		<ul class="pagination pull-right pagination-sm">
			<li><a>共 ${page.totalElements} 条数据</a></li>
			<@pg.pager items=page.totalElements?number maxPageItems=20 export="currentPageNumber=pageNumber" url="${ctx}/operationlog/list">
				<@pg.param name="operating" value="${operating?if_exists}"/>
				<#if start??>
					<@pg.param name="startTime" value="${start?string('yyyy-MM-dd')}"/>
				</#if>
				<#if end??>
					<@pg.param name="endTime" value="${end?string('yyyy-MM-dd')}"/>
				</#if>
				<@pg.index>
					<@pg.first>
						<li><a href="${pageUrl}">&laquo;</a></li>
					</@pg.first>
					<@pg.prev>
						<li><a href="${pageUrl}">&lsaquo;</a></li>
					</@pg.prev>
					<@pg.pages>
						<#if  currentPageNumber == pageNumber >
							<li class="active"><a href="#">${pageNumber}</a></li>
						<#else>
							<li><a href="${pageUrl}">${pageNumber}</a></li>
						</#if>
					</@pg.pages>
					<@pg.next>
						<li><a href="${pageUrl}">&rsaquo;</a></li>
					</@pg.next>
					<@pg.last>
						<li><a href="${pageUrl}">&raquo;</a></li>
					</@pg.last>
				</@pg.index>
			</@pg.pager>
		</ul>
		</#if>
	</div>
	</div>
	</div>
</div>

<!--导出-->
<div class="form-horizontal">
	<div class="modal fade" id="dialog_export" data-backdrop="static">
	   <div class="modal-dialog modal-lg">
	     <div class="modal-content">
	    	<div class="modal-header">
	    		<button type="button" class="close" data-dismiss="modal" aria-hidden="false">&times;</button>
	        	<h4 class="modal-title">正在导出...，请不要刷新或离开当前页面</h4>
	        </div>
		    <div class="modal-body">
			  	<div class="progress" id="export_process" style="display:none;">
				  <div class="progress-bar progress-bar-info progress-bar-striped active" style="width: 1%">
				    <span>0% 已完成</span>
				  </div>
				</div>
			  	<div class="form-group">
                	<div class="col-sm-12" id="errormessage_div">
	            	</div>
                </div>
	     	</div>
	     </div>
	  </div>
	</div>
</div>

</@override>
<@override name="footer">
<script src="${ctx}/assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="${ctx}/assets/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${ctx}/assets/js/operationlog/operationlog.js"></script>
<script type="text/javascript">
	
</script>
</@override>
<@extends name="../layout.ftl"/>